Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(JobAttachments): Ignore empty lists for job attachments #181

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

marofke
Copy link
Contributor

@marofke marofke commented Feb 15, 2024

What was the problem/requirement? (What/Why)

If customers have SHARED Storage Profiles configured for their Queue and are using Job Attachments, they can get into a state where they have no Job Attachments to upload. This hit an edge case where an empty Attachments object is passed to the CreateJob API, causing a submission error.

What was the solution? (How)

The S3AssetManager.prepare_assets_for_upload function returns a AssetUploadGroup object that can contain a list of AssetRootGroups. These AssetRootGroups are what ultimately become the attachments.manifests objects in the CreateJob API call. So if the list of AssetRootGroups in the AssetUploadGroup is empty, we know we don't have any Job Attachments, so we don't continue down any Job Attachments code paths, as there's no work to do.

What is the impact of this change?

Customers submitting jobs with SHARED storage profiles configured with their Queue should be able to submit successfully without needing Job Attachments.

How was this change tested?

  • Confirmed unit and integration tests passed
  • Set up a SHARED storage profile location, and submitted a job bundle with files under that location with both CLI and GUI submit methods
    • with changes from mainline, confirmed submit job failed with "Error Occurred: Parameter validation failed:
      Invalid length for parameter attachments.manifests, value: 0, valid min length: 1"
    • resubmitted with these changes, confirmed it submitted successfully, without any Job Attachments prompts (as there were no Job Attachments)
    • resubmitted AGAIN with an output directory set outside of the Storage Profile, and confirmed Job Attachments were created

Was this change documented?

N/A

Is this a breaking change?

No

Signed-off-by: Caden Marofke <marofke@amazon.com>
@marofke marofke requested a review from a team as a code owner February 15, 2024 21:45
@marofke marofke merged commit 7c63a75 into mainline Feb 15, 2024
18 checks passed
YutongLi291 pushed a commit that referenced this pull request Feb 21, 2024
Signed-off-by: Caden Marofke <marofke@amazon.com>
@marofke marofke deleted the marofke/skip-ja-upload-if-empty branch February 21, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants